import {createApp} from 'vue'
import App from './App.vue'
import router from "@/router";
import store from "@/store";
import '@/utils/create'
import 'vant/lib/index.less'
import '@/permission'
import '@/utils/flexble'
import i18n from "@/locale/index";
import vConsole from 'vconsole'
import {
    Checkbox,
    Button,
    Switch,
    Tabbar,
    TabbarItem,
    icon,
    CheckboxGroup,
    ActionSheet,
    NavBar,
    DatetimePicker,
    Uploader,
    Picker,
    Cascader,
    Field,
    Cell,
    Loading,
    Popup,
    Step,
    Steps,
    Overlay,
    Radio,
    RadioGroup,
    Toast,
    SwipeItem,
    Swipe,
    Tab,
    Tabs,
    Rate,
    CountDown,
    NoticeBar,
    Popover,
} from "vant";
import {dateFormat} from "@/utils/tool";
// 设置全局Toast配置
Toast.setDefaultOptions({duration: 3000});
const app = createApp(App);
if (process.env['NODE_ENV'] !== 'production') {
    new vConsole()
}
app.config.globalProperties.$dateFormat = dateFormat
app.config.globalProperties.$productName = process.env["VUE_APP_NAME"]
app.use(Button)
    .use(Rate)
    .use(NoticeBar)
    .use(CountDown)
    .use(Switch)
    .use(Tabbar)
    .use(TabbarItem)
    .use(Cascader)
    .use(router)
    .use(i18n)
    .use(store)
    .use(Popup)
    .use(icon)
    .use(CheckboxGroup)
    .use(ActionSheet)
    .use(NavBar)
    .use(DatetimePicker)
    .use(Uploader)
    .use(Picker)
    .use(Field)
    .use(Cell)
    .use(Loading)
    .use(Overlay)
    .use(Step)
    .use(Steps)
    .use(Radio)
    .use(RadioGroup)
    .use(Checkbox)
    .use(SwipeItem)
    .use(Swipe)
    .use(Tab)
    .use(Tabs)
    .use(Popover)
app.mount('#app')
